const express = require("express");

const app = express();

const ejs = require("ejs");

const path = require("path");
app.listen(4500,()=>{
    console.log("4500端口已经开放");
})
//设置模板引擎
app.set('view engine','ejs');

app.set('views',path.join(__dirname,"module"));

app.engine('html',ejs.__express)//修改ejs后缀

app.get("/detail",(req,res)=>{
    let stu = [{"name":"张三","age":21,"gender":"男"},
{"name":"李四","age":20,"gender":"男"},
{"name":"王五","age":18,"gender":"男"},
{"name":"赵六","age":19,"gender":"女"}];
    res.render("tip.html",{stu})//渲染tip.html
})
